secant method with error analysis